home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C & C++ Multimedia Cyber Classroom
/
C and C++ Multimedia Cyber Classroom (Prentice Hall) (1998).iso
/
src
/
fig19_03.jar
/
Ch19
/
Fig19_03
/
fig19_03.cpp
Wrap
C/C++ Source or Header
|
1997-11-01
|
343b
|
17 lines
// Fig. 19.3: fig19_03.cpp
// Demonstrating function substr
#include <iostream>
#include <string>
using namespace std;
int main()
{
string s( "The airplane flew away." );
// retrieve the substring "plane" which
// begins at subscript 7 and consists of 5 elements
cout << s.substr( 7, 5 ) << endl;
return 0;
}